/**
 * Created by SunLunatic on 2015/4/2.
 */
var multipart = require('connect-multiparty');
var base = require("../controller/base");
var article = require("../controller/article");
var ue = require('../controller/ue');
var music = require('../controller/music');
var project = require('../controller/project');
var multipartMiddleware = multipart();

function route(app){
    app.get("/article/modify/:id", article.modify);
    app.get("/article/write", article.write);
    app.get("/article/:id", article.show);
    app.post("/article/insert", article.insert);

    app.get("/music", music.list);

    app.post("/project/loadTree", project.loadTree);
    app.get("/project/:target", project.toPage);

    app.use('/ue', multipartMiddleware, ue.uEidtor);

    app.get("/", base.homepage);
}

exports.route = route;